//设置全局title flex布局
.el-menu-item,
.el-submenu {
  &.is-disabled.no-disabled {
    opacity: 1 !important;
    cursor: pointer !important;
    &:hover,
    &.is-active {
      color: #008cff !important;
      background: #f0f9ff !important;
    }

    &:focus {
      background: #ffffff;
    }
  }
  .el-submenu__title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    background: #ffffff;
    color: #666666;
    font-size: 16px;

    &:hover,
    &.is-active {
      color: #008cff;
      background: #f0f9ff;
    }

    &:focus {
      background: #ffffff;
    }

    // 子元素有 角标时  父元素要设置 角标
    .parent-dot {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      right: 8px;
      width: 8px;
      height: 8px;
      background: #ff3f3f;
      border-radius: 50%;
    }
  }

  .sign {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #ff3f3f;
    border-radius: 50%;
  }

  .sign-num {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
    width: 24px;
    height: 24px;
    font-size: 12px;
    line-height: 24px;
    text-align: center;
    color: #fff;
    background: #ff3f3f;
    border-radius: 50%;
  }
}

.el-submenu .el-submenu__title {
  .sign {
    right: 40px;
  }
  .sign-num {
    right: 40px;
  }
}
//收起菜单时不设置 display flex
.hide-side {
  .el-menu-item,
  .el-submenu .el-submenu__title {
    display: block;

    .sign,
    .sign-num {
      right: 6px;
    }
  }
}

#app {
  .xiaobu-main-container {
    min-height: 100%;
    margin-left: $LayoutSidebarWidth;
    position: relative;
  }

  /* 侧边菜单了开始 */
  .xiaobu-sidebar-container {
    transition: width 0.36s;
    width: $LayoutSidebarWidth;
    background: #ffffff;
    overflow: hidden;
    .xiaobu-sidebar-box {
      box-shadow: 2px 0px 4px 0px rgba(0, 0, 0, 0.1);
      width: calc(100% - 2px);
    }

    /* 滚动条相关开始 */
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
        0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }

    .is-horizontal {
      display: none;
    }

    /* 滚动条相关结束 */

    /* 侧边栏菜单样式开始 */
    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
      background: #ffffff;

      //当前页在子菜单时 父菜单文字样式
      .is-active > .el-submenu__title {
        color: #008cff;
      }
    }

    a {
      display: block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      margin-right: 8px;
      font-size: 16px;
    }

    .el-submenu__icon-arrow {
      font-size: 14px;
      font-size: #666666;
    }

    .el-submenu.is-opened > .el-submenu__title .el-submenu__icon-arrow {
      transform: rotateZ(180deg);
    }
  }

  //收起时 侧边菜单样式
  .hideSidebar {
    .xiaobu-main-container {
      margin-left: $LayoutSmallSideWidth;
    }

    .xiaobu-sidebar-container {
      width: $LayoutSmallSideWidth !important;

      .el-menu-item,
      .el-submenu {
        text-align: center;
        overflow: hidden;
        font-size: 16px;
        .el-tooltip {
          padding: 0 !important;
          text-align: center;

          .svg-icon {
            margin: 0;
          }
        }

        .el-submenu__title {
          font-size: 16px;
          padding: 0 !important;
          white-space: nowrap;

          .svg-icon:not(.svg-external-icon),
          .sub-el-icon {
            width: 100%;
            margin: 0;
          }
          .svg-icon-box {
            width: 100%;
            height: 100%;
            display: block;
            margin: 0;
            .svg-external-icon {
              margin: 0;
            }
          }
        }
      }
      .el-submenu {
        .el-submenu__icon-arrow {
          display: none;
        }
      }
    }

    .el-menu--collapse .el-menu .el-submenu {
      min-width: $LayoutSidebarWidth !important;
    }

    .el-menu--collapse {
      .el-submenu__title,
      .el-tooltip {
        position: relative;
        font-size: 16px;
      }
    }
  }

  // 移动端
  .mobile {
    .xiaobu-main-container {
      margin-left: 0px !important;
      width: 100% !important;
      .header-box {
        width: 100% !important;
      }
    }

    .xiaobu-sidebar-container {
      transition: transform 0.36s;
      width: $LayoutSidebarWidth !important;
    }

    &.hideSidebar {
      .xiaobu-sidebar-container {
        pointer-events: none;
        transition-duration: 0.36s;
        transform: translate3d(-$LayoutSidebarWidth, 0, 0);
      }
    }
  }
}

// 菜单折叠时 子菜单样式
html {
  .el-menu--vertical {
    .nest-menu {
      width: $LayoutSidebarWidth;
    }
  }
}

.el-menu--vertical {
  & > .el-menu {
    background: #ffffff;

    .svg-icon {
      margin-right: 16px;
      font-size: 16px;
    }

    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }
  }

  .el-submenu__icon-arrow.el-icon-arrow-right {
    font-size: 14px;
    color: #666666;
  }

  .el-submenu.is-opened > .el-submenu__title .el-submenu__icon-arrow {
    transform: rotateZ(180deg);
  }

  // 当子菜单过长时，会出现滚动条
  > .el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}
